﻿<!DOCTYPE html>
<html>
<!-- 个人评估表 -->

<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
        <script src="/static/js/common.js"></script>

    <style>
        .el-dialog__body {
            height: 100% !important;
        }

        .el-dialog.is-fullscreen {
            overflow: hidden !important;
        }
    </style>
</head>

<body>
    
<div id="app" v-cloak>   
        <el-form label-position="right" ref="form" :inline="true" :model="formInline" class="demo-form-inline"
                 style="margin-bottom: 15px;">
            <el-row>
                <el-col class="head-tool">
                    
<div class="new_title fl"><strong><img src="/static/images/icon1.png" />个人评估表</strong></div>

                    <span>
                        <btn :text="col.btnSelect" imgsrc="/static/images/search.png" linetype="3" @click="onSubmit">
                        </btn>
                        <!--<btn :text="col.btnAdd" linetype="3" @click="UserInput('tj')"></btn>-->
                        <btn text="个人评估" imgsrc="/static/images/search.png" linetype="3" @click="FileAudit('tj')"></btn>
                        <btn text="领导评估" imgsrc="/static/images/search.png" linetype="4" @click="FileAudit('ldtj')"></btn>
                    </span>
                </el-col>

                <el-col :xs="6" :sm="6" :md="6" :lg="4" :xl="4">
                    <div class="elst-select-mini">
                        <el-form-item>
                            <el-input v-model="formInline.model.years" :placeholder="PerformanceAssessPlan.Years" size="mini">
                                <template slot="prepend">
                                    {{PerformanceAssessPlan.Years+mark.m}}
                                </template>
                            </el-input>
                        </el-form-item>
                    </div>
                </el-col>

                <el-col :xs="6" :sm="6" :md="6" :lg="4" :xl="4">
                    <div class="elst-select-mini">
                        <el-form-item>
                            <el-input v-model="formInline.model.assessObj" :placeholder="PerformanceAssessPlan.AssessObj" size="mini">
                                <template slot="prepend">
                                    {{PerformanceAssessPlan.AssessObj+mark.m}}
                                </template>
                            </el-input>
                        </el-form-item>
                    </div>
                </el-col>
            </el-row>
        </el-form>
        <el-table ref="table" stripe :data="ListItem.tableData" :row-key="getRowKeys" :height="ListItem.tableHeight"
                  border @selection-change="handleSelectionChange" row-style="height:10px" style="width: 100%;">
            <el-table-column type="selection" style="
        padding-top: 0px;
        padding-bottom: 0px;
    " align="center" width="55" :reserve-selection="true">
            </el-table-column>
            <el-table-column type="index" :label="col.SequenceNumber" :index="indexMethod" width="50"
                             show-overflow-tooltip="true"></el-table-column>
            <el-table-column prop="years" :label="PerformanceAssessPlan.Years" width="100"
                             show-overflow-tooltip="true">
            </el-table-column>
            <el-table-column prop="assessPurpose" :label="PerformanceAssessPlan.AssessPurpose" width="200" show-overflow-tooltip="true">
                <template slot-scope="scope">
                    <el-button type="text" @click="label_click('xz',scope.row.id)">
                        {{scope.row.assessPurpose}}
                    </el-button>
                </template>
            </el-table-column>
            <el-table-column prop="assessTime" :label="PerformanceAssessPlan.AssessTime" width="100">
            </el-table-column>
            <el-table-column prop="assessContent" :label="PerformanceAssessPlan.AssessContent" min-width="100">
            </el-table-column>
            <el-table-column prop="assessObj" :label="PerformanceAssessPlan.AssessObj" width="100">
            </el-table-column>
            <el-table-column prop="reviewGroup" :label="PerformanceAssessPlan.ReviewGroup" width="150">
            </el-table-column>
            <el-table-column prop="assessMethod" :label="PerformanceAssessPlan.AssessMethod" width="250">
            </el-table-column>
            <!--负责人-->
            <el-table-column prop="OverdueScope"  :formatter="getDicValue" :label="PerformanceAssessPlan.Evaluator" width="250">
            </el-table-column>

            

        </el-table>
        <el-row type="flex" justify="end">
            <el-pagination ref="page" @size-change="handleSizeChange" @current-change="handleCurrentChange"
                           :current-page="ListItem.currentPage" :page-sizes="ListItem.pagesizes" :page-size="ListItem.pagesize"
                           :layout="ListItem.layout" :total="ListItem.total">
            </el-pagination>
        </el-row>
        <!-- 弹出页 -->
        <el-dialog title="履职能力评估计划" :visible.sync="ListItem.dialogVisible" @close='closeDialog' width="80%"
                   height="80%" top="10vh" fullscreen="true">
            <iframe ref="iframe" :src="ListItem.InputUrl" style="height:95%;width:100%" frameborder="0"></iframe>
        </el-dialog>
    </div>
    <script type="text/javascript">
        var app = new Vue({
            el: '#app',
            data: {
                multipleSelection: [],
                mydata: PersonInChargeTree,
                //表单内容
                ListItem: ListItem,
                //获取下拉菜单situation
                situation: [],
                formInline: {
                    model: {
                        name: '',
                        years: '',
                        assessObj:'',
                    },
                    offset: 0,
                    limit: 10,
                    btntname:'综合评估报告',
                },
               
               
            },
            created: function () {
                //var currApp = this;
                //window.onresize = function () {
                //    currApp.ListItem.tableHeight = window.innerHeight -
                //        currApp.$refs.table.$el.offsetTop - 60;
                //    if (currApp.ListItem.tableHeight < 112) {
                //        currApp.ListItem.tableHeight = 112;
                //    }
                //}
            },
            mounted: function () {

                console.log(getDicDataArray(["01", "02", "03", "04"]))

                //获取下拉菜单内容
                this.situation = getDicData('54');


                //初始化数据
                this.GetPageData(1);
                //列表高度自适应
                tablehigh(this);


                //this.OverdueScope = fn(this.mydata, "0");
            },
            methods: {
                //解決edge下select bug
                visibleChange: function (isVisible) {
                    visibleChange(isVisible)
                },

                //评审实现
                FileAudit: function (bz) {
                    if (this.multipleSelection.length == 0) {
                        alert("请选择评估项！");
                    }
                    else {
                        
                        if (this.multipleSelection.length == 1) {

                            var sid = "";
                            var j = 0;
                            for (var i = 0; i < this.multipleSelection.length; i++) {
                                sid = this.multipleSelection[i].id;
                                //sCAM_Compliance = this.multipleSelection[i].CAM_Compliance;
                            }
                            if (bz == "tj") {
                                DialogShow(this, 'xg', "PersonalAssessmentTable.html", sid);
                            } else {
                                DialogShow(this, 'xg', "PersonalAssessmentTable_Leader.html", sid);
                            }

                        } else {
                            alert("不可以选择多个！");
                        }

                    }
                    //console.log(a);
                },

                getDicValue: function (row, column, cellValue, index) {
                    if (cellValue) {
                        if (typeof cellValue === 'string' || typeof cellValue === 'number') {
                            return getTreeValue(this.mydata, cellValue)
                        }
                        else {
                            var result = '';
                            for (var i = 0; i < cellValue.length; i++) {
                                result += getTreeValue(this.mydata, cellValue[i]) + ',';
                            }
                            result = result.substr(0, result.length - 1);
                            return result;
                        }
                    }

                },
                indexMethod: function (index) {
                    return (this.ListItem.currentPage - 1) * this.ListItem.pagesize + index + 1;
                },
                //关闭Dialog 回调
                closeDialog: function () { closeDialog(this); },
                //删除方法
                onDelete: function () { onDelete(this, '/api/DutiesAndResponsibilities/DeleteMuti'); },
                //列表选择触发
               // handleSelectionChange: function (val) { handleSelectionChange(this, val); },
                //列表选择触发
                handleSelectionChange: function (val) { this.multipleSelection = val; },
                //Dialog展示
                UserInput: function (val, id) {
                    console.log("xxxxxxx",val);
                    DialogShow(this, val, "PerformanceAssessPlanInput.html", id);

                    if (val == "xg") {
                        DialogShow(this, val, "PerformanceAssessPlanInput.html", id);
                    }
                    if (val == "ck") {
                        DialogShow(this, val, "PerformanceAssessPlanShow.html", id);
                    }
                    if (val == "sp") {
                        DialogShow(this, val, "PerformanceAssessPlanResult.html", id);
                    }

                },
                //获取分页数据
                GetPageData: function (currentIndex) { GetPageData(this, currentIndex, '/api/DutiesAndResponsibilities/PGGetList') },
                //查询方法
                onSubmit: function () { onSubmit(this); },
                //pagesize改变 触发方法
                handleSizeChange: function (val) { handleSizeChange(this, val); },
                //跳页触发方法
                handleCurrentChange: function (val) { handleCurrentChange(this, val); },
                //获取下拉菜单数据
                getDropDown: function () {
                },

                //点击表格中数据发生方法
                label_click: function (val, id) { DialogShow(this, val, "PersonalAssessmentTableDetails.html", id); },

            }
        });
    </script>
</body>

</html>